﻿<Window x:Class="SlideShowDFG2.SettingsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:SlideShowDFG2"
    Loaded="Window_Loaded"
    Title="SlideShowDFG2 - Setttings" Height="466" Width="353" ShowInTaskbar="False">
    <Window.Resources>
        <ObjectDataProvider x:Key="ResizeOptions" MethodName="GetValues" ObjectType="{x:Type local:ResizeOptions}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="local:ResizeOptions" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        
        <local:EnumDescriptionConverter x:Key="EnumDescConverter" />
        
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Margin" Value="5" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="135" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="60" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <TextBlock Grid.Column="0" Grid.Row="0">Resize Option</TextBlock>
        
        <ComboBox Grid.Column="1" Grid.Row="0" Height="23"
                  VerticalAlignment="Center" Margin="5"
                  ItemsSource="{Binding Source={StaticResource ResizeOptions}}"
                  SelectedIndex="{Binding Path=ResizeOption}"> 
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Converter={StaticResource EnumDescConverter}}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        
        <TextBlock Grid.Column="0" Grid.Row="1">New Size</TextBlock>
        
        <TextBox Grid.Column="1" Grid.Row="1" Height="23"
                 VerticalAlignment="Center" Margin="5"
                 Text="{Binding Path=ResizeSeed}" />
        
        <TextBlock Grid.Column="0" Grid.Row="2">Create Thumbnails</TextBlock>
        
        <CheckBox Grid.Column="1" Grid.Row="2" 
                  VerticalAlignment="Center" HorizontalAlignment="Center"
                  IsChecked="{Binding Path=CreateThumbnail}" />
        
        <TextBlock Grid.Column="0" Grid.Row="3">Watermark Images</TextBlock>
        
        <CheckBox Grid.Column="1" Grid.Row="3"
                  VerticalAlignment="Center" HorizontalAlignment="Center"
                  IsChecked="{Binding Path=EnableWatermark}" />
                  
        <TextBlock Grid.Column="0" Grid.Row="4">Watermark Text</TextBlock>
        
        <TextBox Grid.Column="1" Grid.Row="4" Height="23"
                 VerticalAlignment="Center" Margin="5"
                 Text="{Binding Path=WatermarkText}" />
        
        <TextBlock Grid.Column="0" Grid.Row="5">FFmpeg Executable</TextBlock>
        <StackPanel Grid.Column="1" Grid.Row="5" Margin="5" >
            <TextBox Text="{Binding Path=FFmpegExe}" />
            <Separator Background="White" />
            <Button Name="btnFFmpegBrowse" Click="btnFFmpegBroswe_Click">Browse...</Button>
        </StackPanel>
        
        <TextBlock Grid.Column="0" Grid.Row="6">Video Size</TextBlock>
        <TextBox Grid.Column="1" Grid.Row="6" Height="23"
                 VerticalAlignment="Center" Margin="5"
                 Text="{Binding Path=VideoSize}" /> 
        
        <TextBlock Grid.Column="0" Grid.Row="7">Video Bitrate</TextBlock>
        <TextBox Grid.Column="1" Grid.Row="7" Height="23"
                 VerticalAlignment="Center" Margin="5"
                 Text="{Binding Path=VideoBitrate}" />

        <Button Grid.Column="0" Grid.Row="8"
                Name="btnClose" IsDefault="True" Click="btnClose_Click"
                VerticalAlignment="Center" Margin="5"
                Content="Close" />
    </Grid>
</Window>
